import { createRouter, createWebHistory } from 'vue-router'


const routes = [{
  path: '/',
  redirect: '/home/index/remm'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '@/views/login')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "home" */ '@/views/home'),
    children: [{
      path: '/home/index',
      name: 'index',
      component: () => import(/* webpackChunkName: "index" */ '@/views/home/index/index.vue'),
      children: [{
        path: '/home/index/remm',
        name: 'remm',
        component: () => import(/* webpackChunkName: "remm" */ '@/views/home/index/remm'),
      },{
        path: '/home/index/java',
        name: 'java',
        component: () => import(/* webpackChunkName: "java" */ '@/views/home/index/java'),
      },{
        path: '/home/index/web',
        name: 'web',
        component: () => import(/* webpackChunkName: "web" */ '@/views/home/index/web'),
      }]
    },{
      path: '/home/hot',
      name: 'hot',
      component: () => import(/* webpackChunkName: "hot" */ '@/views/home/hot'),
    },{
      path: '/home/info',
      name: 'info',
      component: () => import(/* webpackChunkName: "info" */ '@/views/home/info'),
    },{
      path: '/home/post/:id',
      name: 'post',
      component: () => import(/* webpackChunkName: "post" */ '@/views/home/post'),
    }]
  },
  {
    path: '/write',
    name: 'write',
    component: () => import(/* webpackChunkName: "write" */ '@/views/write')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
